﻿<!doctype html "5
















                                                VISUAL STUDIO USERS:
                                                press ctrl + shift + w 
                                                to view this documentation in a browser




































">
<style>
    html{font:16px/2 sans-serif; padding:10px 0 60% 0;} 
    body {max-width:1000px; margin:auto; background:white; padding:20px 30px 30px 30px;}
    h1, h2 {border-top:7px solid #ddd; margin-top:30px; padding-top:30px;}  
    h1{border-top-color:#555} pre.inline{display:inline} strong{color:Red}
    #floaty,#floaty:hover,#floaty:visited{display:block; position:fixed; bottom:0; right:15px; padding:15px; color:#555; background:#ddd; text-decoration:none; opacity:0.3}
    #floaty:hover{background:#eee; opacity:0.6} 
	em{margin-left:17px;display:block}
    em, em a,em a:visited, em:hover {font:italic 17px/32px georgia ; color:#555;}
	em a,em a:visited {color:gray; text-decoration:none; border-bottom:1px dashed gray}
	body{ box-shadow:0 0 100px rgba(0,0,0,0.15), inset 0 0 5px 2px white, inset 0 0 20px #fafafa; border-radius:8px}
	#nav,#nav a, #nav a:visited,.gray,#nav ul{ color:#555;list-style-type:none;padding:0 0 0 6px}
	#nav{float:right;padding:20px; background-color:#ddd; margin:0 -31px 15px 30px;border-right:1px solid #d0d0d0;  }
	html,#nav{background-image: url();}
</style>
<body>
<h1>Don't forget my code!</h1>
<em>
a lightweight windows service for applying customisations to enterprise webapps.<br/>
<a href=http://github.com/alirobe>github</a> - <a href=#credit>contact</a> - <a href=https://github.com/alirobe/Append-Customisation-Service/zipball/master>download</a><br>
<br>
</em>
<div id="nav">
<h3 id=contents>Contents:</h3>
    <ul style=margin-left:8px>
       <li><a href=#intent>Overview</a>
       <li><a href=#file>Specifying Files</a>
       <li><a href=#shim>Making the Shim</a>
       <li><a href=#name>Naming the Service</a>
       <li><a href=#maintain>Maintain</a>
       <li><a href=#credit>etc</a>
    </ul>
</div>
<h2 id=intent>Let's do this.</h2>
			<em>"But we can't modify app files! they'll get overridden by updates!"</em>
		<p>Bah. Let's do what we can.</p>
		<p>This service monitors a file and makes sure your code is always appended to the end of the file. Disable the service, and your customisations go away. That should do the trick for your average JavaScript/CSS customisation.
    <ul>
        <li>triggered by <i>any</i> change to the application's file.
        <li>turn off the service = turn off the customisation.
		<li>you can name the service anything you want
		<li>creates comprehensive backup trail. (coming soon)
    </ul>


<h2 id=file>Setup.</h2>
    <h3>For Mortals</h3>
    <ol>
		<li>Download, extract, and copy the 'append customisation service/bin/release' folder to a program files directory (let's call it "AppendCustomisationService").
        <li>Open the XML file "AppendCustomisationService.exe.<b>config</b>" and provide it with both the file to monitor, and the file to be appended. Save.
		<li>Right click 'install.ps1' and click 'Run with Powershell'. If you're prompted for a service name, type 'AppendCustomisationService' (note the non-US spelling)
		<li class=gray>Start &rarr; Run &rarr; services.msc to view the service.
    </ol>
	<h3>For Developers</h3>
    <ol>
		<li>Download, extract and open the project in Visual Studio.
        <li>Edit app.config
		<li>Compile
		<li>Put the full set of compiled output in a Program Files directory (or somewhere safe to run)
        <li>Ensure all files are in place and finalised.
        <li>Run install.ps1 (right click &rarr; run powershell) : your script will immediately run
        <li class=gray>Start &rarr; Run &rarr; services.msc to view the service.
    </ol>
<h2 id=shim>Shim Sham</h2>
	<p>The first line of your file to be appended should start with a comment containing a unique identifier that won't exist in the main file.
    <p>The rest of your shim should be a 'shim' of some sort. I'll leave the details up to you. 
	Ideally it should be some sort of script loader like <a href=http://headjs.com>HeadJS</a>, with some calls to external files.
	
<h2 id=name>Naming The Service</h2>
    <p>This is easy, but it does require compiling...
    <ol>
        <li>run the uninstall.ps1 script first.
        <li>Open AppendCustomisationService.Designer.cs
        <li>Set <pre class=inline>public const string ServiceUniqueName = <b>"Your Service Name"</b></pre>
        <li>Write <pre class=inline>"your service name"</pre> (without quotes) as the only text in install.cfg
        <li>Compile.
    </ol>

<h2 id=maintain>How to Review Backups + Logs</h2>
	<p>Windows Application Log contains output from this service
	<p>Backups (COMING SOON) stored in the same folder as the file being monitored (timestamped)

<h2 id=credit>Etcetera, Etcetera, Etcetera...</h2>
	Developed by some twep on a lark in less than 8 hours... Don't expect magic!
	<h3>Todo</h3>
	<ul>
		<li>Fix Backups (the files aren't created!)
		<li>Test
		<li>Write tests
		<li>Implement somewhere
		<li>Two-way binding
		</ul>
	<h3>Contact</h3>
		<blockquote>questions to <a href=http://twitter.com/alirobe>@alirobe</a>, misc resources at <a href=http://get-spblog.com>get-spblog.com</a>
	</blockquote>

<a id=floaty href=#contents>Back to top</a>
<!-- this file written in valid/acceptable HTML5. Tested in IE7+ -->